﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Dialog.Master" AutoEventWireup="true"
    CodeBehind="ChooseListing.aspx.cs" Inherits="SaleDiscount.Portal.ChooseListing" %>

<%@ Import Namespace="NetDon.Utilities" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script language="javascript" type="text/javascript">
        function SelectAll(evtObj) {
            Array.forEach($array($get('<%=grdInvoiceOrder.ClientID %>').getElementsByTagName("input")), function (elt) {

                if (elt.type == "checkbox" && elt.disabled == false) {
                    elt.checked = evtObj.checked;
                }
            })
        }
      
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Panel runat="server" DefaultButton="btnSave" ID="Panel1" Style="overflow: hidden">
        <asp:Panel ID="Panel2" runat="server" DefaultButton="btnSearch">
            <table border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        <NetDon:FormPanel ID="PanelCondition" runat="server" CaptionAlign="NotSet" RepeatColumns="2">
                            <Items>
                              <%--  <NetDon:FormItem HeaderText="Keywords <Br/>in the item titles">
                                    <ContentTemplate>
                                        <asp:TextBox ID="txtKeywords" runat="server"></asp:TextBox>
                                    </ContentTemplate>
                                </NetDon:FormItem>
                                <NetDon:FormItem HeaderText="Store Category">
                                    <ContentTemplate>
                                        <asp:DropDownList ID="ddlStoreCategory" AppendDataBoundItems="True" runat="server">
                                        </asp:DropDownList>
                                    </ContentTemplate>
                                </NetDon:FormItem>--%>
                                <NetDon:FormItem HeaderText="Sort by">
                                    <ContentTemplate>
                                        <asp:DropDownList ID="ddlSortBy" runat="server" AppendDataBoundItems="true">
                                        </asp:DropDownList>
                                    </ContentTemplate>
                                </NetDon:FormItem>
                                <NetDon:FormItem HeaderText="Listing Format">
                                    <ContentTemplate>
                                        <asp:DropDownList ID="ddlListingFormat" runat="server" AppendDataBoundItems="true">
                                        </asp:DropDownList>
                                    </ContentTemplate>
                                </NetDon:FormItem>
                             <%--   <NetDon:FormItem HeaderText="Price Range">
                                    <ContentTemplate>
                                        From US $<asp:TextBox ID="txtPriceStart" runat="server" Width="60px"></asp:TextBox>
                                        to: US $
                                        <asp:TextBox ID="txtPriceEnd" runat="server" Width="60px"></asp:TextBox>
                                    </ContentTemplate>
                                </NetDon:FormItem>--%>
                            </Items>
                        </NetDon:FormPanel>
                    </td>
                    <td valign="bottom">
                        <asp:Button ID="btnSearch" runat="server" Text="Search" SkinID="Button80" OnClick="btnSearch_Click" />
                    </td>
                </tr>
            </table>
        </asp:Panel>
        <div style="margin-top: 10px">
            <NetDon:GridView ID="grdInvoiceOrder" BorderWidth="0px" CellPadding="0" CellSpacing="0"
                Width="100%" AutoGenerateColumns="false" runat="server" OnRowDataBound="grdInvoiceOrder_RowDataBound">
                <Columns>
                    <NetDon:TemplateField>
                        <HeaderStyle HorizontalAlign="Center" />
                        <HeaderTemplate>
                            <asp:CheckBox ID="chkSelectAll" runat="server" onclick="SelectAll(this)" />
                        </HeaderTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                        <ItemTemplate>
                            <asp:CheckBox ID="chkSelect" runat="server" />
                        </ItemTemplate>
                    </NetDon:TemplateField>
                    <NetDon:TemplateField HeaderText="Picture">
                        <ItemTemplate>
                            <asp:Image runat="server" ID="imge1" ImageUrl='<%#GetImageUrl(Eval("PicitureURL"))%>' />
                        </ItemTemplate>
                    </NetDon:TemplateField>
                    
                       <NetDon:TemplateField HeaderText="Item#">
                        <ItemTemplate>
                             <%#GetItemTitle(Eval("ItemId"), Eval("Title"))%>
                        </ItemTemplate>
                    </NetDon:TemplateField>
                    <asp:BoundField HeaderText="Current Price" DataField="CurrentPrice"  SortExpression="CurrentPrice">
                    </asp:BoundField>
                      <asp:BoundField HeaderText="Qty" DataField="Qty" >
                    </asp:BoundField>
                    <asp:BoundField HeaderText="Shipping" DataField="ShippingCost" >
                    </asp:BoundField>
                  
                      <NetDon:TemplateField HeaderText="Item Format"  SortExpression="ItemFormat" >
                        <ItemTemplate>
                            <asp:Image runat="server" ID="imge2" ImageUrl='<%#GeItemFormatImageUrl(Eval("ItemFormat"))%>' />
                        </ItemTemplate>
                    </NetDon:TemplateField>
                    <NetDon:TemplateField HeaderText="(PST) End Date" >
                        <ItemTemplate>
                         <%#Eval("EndDate") != null ? ((DateTime)Eval("EndDate")).ToString("MM/dd/yyyy HH:mm:ss") : ""%>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Right"></ItemStyle>
                    </NetDon:TemplateField>
                </Columns>
                <HeaderStyle CssClass="test" />
                <RowStyle CssClass="test" />
                <AlternatingRowStyle CssClass="GridRow1" />
            </NetDon:GridView>
        </div>
        <div style="margin-top: 10px; text-align: center;">
            <asp:ValidationSummary ID="ValidationSummary2" runat="server" DisplayMode="List"
                ShowMessageBox="True" ShowSummary="False" />
            <asp:Button ID="btnSave" runat="server" Text="Continue" OnClick="btnChoose_Click"
                Style="margin-right: 5px"></asp:Button>
            <asp:Button ID="btnCancel" runat="server" Text="Cancel" CausesValidation="false"
                SkinID="Button60" Style="margin-left: 5px"></asp:Button>
        </div>
    </asp:Panel>
</asp:Content>
